From 9e2b1ad39e86b2352116f49214cf195cb3e0e970 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Thu, 6 Oct 2016 16:49:39 +0200 Subject: [PATCH] gdkwindow: configure native windows in move_native_children() ClutterEmbed on Wayland uses a subsurface and relocates it on configure events, but when placed within a scrolled window, no configure event is emitted and the ClutterEmbed subsurface remains static. Emit a configure event for native windows in GdkWindow's internal move_native_children() so that custom widgets relying on configure events such as ClutterEmbed can relocate their stuff. Similarly, when switching to/from normal/maximized/fullscreen states which change the shadows' size and possibly shows/hides a header bar, we need to emit a configure event even if the abs_x/abs_y haven't changed to make sure the subsurface is size appropriately. https://bugzilla.gnome.org/show_bug.cgi?id=771320 https://bugzilla.gnome.org/show_bug.cgi?id=767713 --- gdk/gdkwindow.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index 514732d818..bc156dd3d7 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -5972,6 +5972,24 @@ gdk_window_move_resize_toplevel (GdkWindow *window, _gdk_synthesize_crossing_events_for_geometry_change (window); } +static void +configure_native_child (GdkWindow *window) +{ + GdkDisplay *display; + GdkEvent *event; + + event = gdk_event_new (GDK_CONFIGURE); + + event->configure.window = g_object_ref (window); + event->configure.send_event = FALSE; + event->configure.x = window->x; + event->configure.y = window->y; + event->configure.width = window->width; + event->configure.height = window->height; + + gdk_event_put (event); + gdk_event_free (event); +} static void move_native_children (GdkWindow *private) @@ -5992,7 +6010,10 @@ move_native_children (GdkWindow *private) child->width, child->height); } else - move_native_children (child); + { + configure_native_child (child); + move_native_children (child); + } } } @@ -6080,8 +6101,7 @@ gdk_window_move_resize_internal (GdkWindow *window, window->x, window->y, window->width, window->height); } - else if (old_abs_x != window->abs_x || - old_abs_y != window->abs_y) + else move_native_children (window); if (expose) -- 2.30.2